package com.api.demo.entity;

import java.util.Date;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;

import lombok.Data;

@Data
@TableName("sys_api_log")
public class ApiLog {
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private String requestId;
    private String method;
    private String path;
    private String queryString;
    private Integer statusCode;
    private Long userId;
    private String username;
    private String clientIp;
    private Long duration;
    private Date requestTime;
    
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private Map<String, String> requestHeaders;
    
    private String requestBody;
    private String responseBody;
    private Long responseSize;
    private String errorMsg;
}